<?php

declare(strict_types=1);

namespace Api\InterfaceApi\v1\Work;

use Api\Service\v1\Work\SeatApiService;
use Hyperf\Di\Annotation\Inject;
use Mine\MineApi;

class SeatApi extends MineApi
{
    #[Inject]
    protected SeatApiService $service;

    /**
     * 席位列表
     * @return \Psr\Http\Message\ResponseInterface
     * @throws \Psr\Container\ContainerExceptionInterface
     * @throws \Psr\Container\NotFoundExceptionInterface
     */
    public function list(): \Psr\Http\Message\ResponseInterface
    {
        return $this->success($this->service->list($this->request->all()));
    }

    /**
     * 绑定账号
     * @return \Psr\Http\Message\ResponseInterface
     * @throws \Psr\Container\ContainerExceptionInterface
     * @throws \Psr\Container\NotFoundExceptionInterface
     */
    public function bind(): \Psr\Http\Message\ResponseInterface
    {
        return $this->service->bind($this->request->all()) ? $this->success() : $this->error();
    }

    public function changeBind(): \Psr\Http\Message\ResponseInterface
    {
        return $this->service->changeBind($this->request->all()) ? $this->success() : $this->error();
    }

    public function checkLicense(): \Psr\Http\Message\ResponseInterface
    {
        return $this->success($this->service->checkLicense($this->request->all()));
    }
}